package org.szy.core.common.param;

import org.noear.solon.validation.annotation.NotBlank;
import org.noear.solon.validation.annotation.NotNull;
import org.szy.core.common.enums.CommonYorNEnum;

import java.io.Serializable;

/**
 * 是或否参数
 *
 * @author 孙志阳
 * @date 2023-02-17
 * @since 1.0.0
 **/
public class CommonYorNParam {

    /**
     * 主键
     */
    @NotBlank(message = "id不能为空")
    private String id;

    /**
     * 状态
     */
    @NotNull(message = "状态不能为空")
    private Integer active;

    public Serializable getId() {
        return id;
    }

    public Integer getStatus() {
        return CommonYorNEnum.findByValue(this.active).getKey();
    }

    public void setId(String id) {
        this.id = id;
    }

    public Integer getActive() {
        return active;
    }

    public void setActive(Integer active) {
        this.active = active;
    }
}
